package com.lms.common.pure.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Schema(name = "节点信息")
public class TreeNode<I extends Serializable> implements ITreeNode<I> {
    @Getter
    @Setter
    @Schema(name = "节点id")
    protected I id;
    @Getter
    @Setter
    @Schema(name = "节点名称")
    protected String name;
    @Setter
    @Getter
    @Schema(name = "节点类型")
    protected String type;
    @Setter
    @Getter
    @Schema(name = "是否虚拟节点")
    protected boolean virtual;
    @Setter
    @Getter
    @Schema(name = "父节点")
    protected ITreeNode<?> parent;
    @Getter
    @Setter
    @Schema(name = "子节点")
    protected List<TreeNode<?>> children = new ArrayList<>();

//    @Override
//    public ITreeNode<?> getParent() {
//        return parent;
//    }
//
//    @Override
//    public void setParent(ITreeNode<?> parent) {
//        this.parent = parent;
//    }
}
